<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Todo List</title>
    <script src="../vue.js"></script>
    <style>
      .activated {
        color: coral;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <div @click="handleDivOneClick" :class="{activated: isActivated}">
        Hello World One with Class Object
      </div>
      <br />
      <div @click="handleDivTwoClick" :class="[activated]">
        Hello World Two with Class Arrary
      </div>
      <br />
      <div @click="handleDivThreeClick" :style="styleObj">
        Hello World Three with Sytle Object
      </div>
      <div @click="handleDivThreeClick" :style="[styleObj,{fontSize:'20px'}]">
        Hello World Three with Sytle Arrary
      </div>
    </div>
    <script>
      var app = new Vue({
        el: '#app',
        data: {
          isActivated: false,
          activated: '',
          styleObj: {
            color: undefined,
            transform: 'translateX(100px)'
          }
        },
        methods: {
          handleDivOneClick() {
            this.isActivated = !this.isActivated
          },
          handleDivTwoClick() {
            this.activated = this.activated ? '' : 'activated'
          },
          handleDivThreeClick() {
            this.styleObj.color = this.styleObj.color ? undefined : 'coral'
          }
        }
      })
    </script>
  </body>
</html>
